import type { AxiosResponse } from 'axios';

import { baseRequestClient } from '#/api/request';

// console.log('import.meta.env', import.meta.env);

export namespace AuthA {
  export interface LoginParams {
    username: string;
    password: string;
    uuid: string;
    code: string;
  }
  export interface LoginResult {
    code: number;
    token: string;
    msg: string;
  }
  export interface GetCaptchaImageResult {
    msg: string;
    img: string;
    code: number;
    captchaOnOff: boolean;
    uuid: string;
  }
}

// 用户登录
export const userLogin = (params: AuthA.LoginParams) =>
  baseRequestClient.post<AxiosResponse<AuthA.LoginResult>>(
    'http://100.122.211.103:8080/login',
    params,
  );
